
/**
 * Date:2019年5月31日下午2:23:29
 * Copyright (c) 2019, www.bwbroad.com All Rights Reserved.
 *
*/

package com.xue.im.common.vo;

import java.util.HashMap;
import java.util.Map;

import com.xue.im.common.IMUtil.MessageType;

/**
 * Description: 消息头部 <br/>
 * Date: 2019年5月31日 下午2:23:29 <br/>
 * 
 * @author xuejianxin
 */
public class Header {
	private int crcCode = 0xabef0101;// 魔数
	private int length;// 消息长度
	//private long sessionId;// 会话id
	private byte type;// 消息类型
	//private byte priority;// 消息优先级
	private Map<String, Object> options = new HashMap<String, Object>();// 其他信息

	public int getCrcCode() {
		return crcCode;
	}

	public void setCrcCode(int crcCode) {
		this.crcCode = crcCode;
	}

	public int getLength() {
		return length;
	}

	public void setLength(int length) {
		this.length = length;
	}

	

	public byte getType() {
		return type;
	}

	public void setType(byte type) {
		this.type = type;
	}

	

	public Map<String, Object> getOptions() {
		return options;
	}

	@Override
	public String toString() {
		//return String.format("Header [crcCode=%s, length=%s, sessionId=%s, type=%s, priority=%s, attachement=%s]",crcCode, length, sessionId, MessageType.name(type), priority, options);
		return String.format("[type=%s, attachement=%s]", MessageType.name(type), options);
	}

}
